/* Copyright 2009 Palm, Inc.  All rights reserved. */

var DialfailAssistant = Class.create({
    initialize: function(message) {
    	QDLogger.log( "DialfailAssistant::initialize", message);
		this.appControl = Mojo.Controller.getAppController();
		this.updateFields(message);
		this.windowName = "fail";
    },
    
    setup: function(){
		this.controller.get('cancel_button').addEventListener(Mojo.Event.tap, this.onCancel.bindAsEventListener(this));
		this.renderScene();
    },
    
	updateFields: function(message) {
		this.message = message;
	},
	
	renderScene: function(){
        QDLogger.log( "DialfailAssistant::renderScene");
		this.controller.get('dropped_message').update(this.message);
    },
	
	
    onCancel: function() {
		this.closeWindow();
	},
    
    
	closeWindow: function() {
		this.appControl.closeStage(this.windowName);
	},
	
});

